package com.hong.spring.entity;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;

/**
 * @author: csh
 * @Date: 2020/12/11 12:03
 * @Description:
 */
public class Student implements Watcher {

    public void process(WatchedEvent watchedEvent) {
        System.out.println("--------------------");
        System.out.println("path:"+watchedEvent.getPath());
        System.out.println("type:"+watchedEvent.getType());
        System.out.println("state:"+watchedEvent.getState());
        System.out.println("--------------------");
        if(Event.KeeperState.SyncConnected.equals(watchedEvent.getState())) {
            if (Event.EventType.None.equals(watchedEvent.getType())) {
                System.out.println("zk连接成功");
            }
        }
    }
}
